import { defineStore }  from 'pinia'
import defaultSettings from '@/settings'

const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings

const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''

const useSettingsStore = defineStore(
    'settings',
    {
        state: () => ({
            sideTheme: storageSetting.sideTheme || sideTheme,
            sidebarLogo : storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo            
        })
    }
)

export default useSettingsStore